local FzEventCenter = {
    event_pool={}
}


function FzEventCenter:RegisterEvent(jjevent,target,fun)
    local targets=self.event_pool[jjevent]
    if targets==nil then
        targets={}
    	self.event_pool[jjevent]=targets
    end
    targets[target]=fun
end

function FzEventCenter:RemoveEvent(jjevent,target)
    local targets=self.event_pool[jjevent]
    if targets~=nil then
    	targets[target]=nil
        if table.nums(targets)==0 then
            self.event_pool[jjevent]=nil
        end
    end
end 

function FzEventCenter:DispichEvent(jjevent)
	local targets=self.event_pool[jjevent]
	if targets ~= nil then
        for target, fun in pairs(targets) do
            fun(target)
        end
	end
end

cc.exports.FzEventCenter = FzEventCenter
return FzEventCenter